//
//  CheckstanPurViewModel.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/15.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "CheckstanPurViewModel.h"
#import "CheckstanHeaderView.h"
#import "PayTypeTableViewCell.h"
#import "CheckstandBottomView.h"

@interface CheckstanPurViewModel ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation CheckstanPurViewModel

-(instancetype)initWithViewToViewModel:(UITableView *)tableView theSuperView:(UIView *)superView{
    if (self = [super initWithViewToViewModel:tableView theSuperView:superView]) {
        tableView.height = tableView.height - kHeightProportion_In_iPhoneTriploid(94);
        tableView.mj_footer.hidden = YES;
        tableView.mj_header.hidden = YES;
        tableView.delegate = self;
        tableView.dataSource = self;
        tableView.rowHeight = kHeightProportion_In_iPhoneTriploid(50);
        tableView.tableHeaderView = [self createHeaderView];
        [superView addSubview:tableView];
        //
        CheckstandBottomView * bottomView = [[CheckstandBottomView alloc] initWithFrame:CGRectMake(0, kY_With_View(tableView, 0), KScreenWidth, kHeightProportion_In_iPhoneTriploid(94)) inSuperView:superView];
    }
    return self;
}


-(UIView *)createHeaderView{
    CheckstanHeaderView * chechHeader = [[CheckstanHeaderView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kHeightProportion_In_iPhoneTriploid(156))];
    return chechHeader;
}


#pragma mark -- UITableViewDelegate,UITableViewDataSource
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    PayTypeTableViewCell * cell = [PayTypeTableViewCell cellWithTableView:tableView];
    [cell setSepartionLineWith:lineModel_Half];
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    PayTypeTableViewCell * cellselect = [tableView cellForRowAtIndexPath:indexPath];
    cellselect.isSelect = YES;
    if (indexPath.row == 0) {
    
    }else{
        
    }
}

@end
